package softtech.app.secretcaller;
import android.content.ContentValues;
public class DatabaseCall {
	
	public static final String TABLE_NAME = "t_call";
	public static final String KEY_PRIMARY = "id";
	public static final String KEY_PHONE ="phone_number";
	public static final String KEY_DATE_TIME = "date_time";
	public static final String KEY_TYPE ="type";
	public static final String KEY_CONTACT_ID = "contact_id";
	
	public static final int INCOMMING = 1;
	public static final int OUTGOING = 2;
	public static final int MISSED = 3;
	
	private int id;
	private long contact_id;
	private String phone;
	private String date;
	private int type;
	private Boolean isFirstCallOfDay;
	
	public DatabaseCall( String ph  , String dt ,int type){
		this(-1 , -1 , ph ,  dt , type);
	}
	
	public DatabaseCall(long con_id , String ph  , String dt ,int type){
		this(-1 , con_id , ph ,  dt , type);
	}
	
	public DatabaseCall(int _id , long con_id , String ph , String dt ,int type){
		id = _id;
		contact_id = con_id;
		phone = ph;
		date = dt;
		this.type =type;  
		isFirstCallOfDay = false;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public long getContact_id() {
		return contact_id;
	}

	public void setContact_id(long contact_id) {
		this.contact_id = contact_id;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}
	
	public Boolean getIsFirstCallOfDay() {
		return isFirstCallOfDay;
	}

	public void setIsFirstCallOfDay(Boolean isFirstCallOfDay) {
		this.isFirstCallOfDay = isFirstCallOfDay;
	}

	public ContentValues toContentValues(){
		ContentValues values = new ContentValues();
		values.put(KEY_CONTACT_ID, contact_id);
		values.put(KEY_DATE_TIME, date);
		values.put(KEY_PHONE, phone);
		values.put(KEY_TYPE, type);
		return values;
	}
	
}
